﻿namespace PluginRegistrationTool
{
    /// <summary>
    /// The XRM Credentials Class.
    /// </summary>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xrm")]
    public class XrmCredentials
    {
        public XrmCredentials Value
        {
            get
            {
                return this;
            }
        }

        /// <summary>
        /// Domain string property.
        /// </summary>
        private string _domain;

        /// <summary>
        /// Domain string property.
        /// </summary>
        public string Domain
        {
            get
            {
                return _domain;
            }
            set
            {
                _domain = value;
            }
        }

        /// <summary>
        /// User name string property.
        /// </summary>
        private string _userName;

        /// <summary>
        /// User name string property.
        /// </summary>
        public string UserName
        {
            get
            {
                return _userName;
            }
            set
            {
                _userName = value;
            }
        }

        /// <summary>
        /// Password string property.
        /// </summary>
        private string _password;

        /// <summary>
        /// Password string property.
        /// </summary>
        public string Password
        {
            get
            {
                return _password;
            }
            set
            {
                _password = value;
            }
        }

        /// <summary>
        /// Has Value?
        /// </summary>
        private bool _hasValue;

        /// <summary>
        /// Has Value?
        /// </summary>
        public bool HasValue
        {
            get
            {
                _hasValue = false;
                if (!string.IsNullOrEmpty(this.UserName) && !string.IsNullOrEmpty(this.Password))
                {
                    _hasValue = true;
                }
                return _hasValue;
            }
        }
    }
}
